package pers.wwz.study.xmlhttphrequest.controller;

import org.springframework.web.bind.annotation.*;
import pers.wwz.study.xmlhttphrequest.common.response.RestResult;
import pers.wwz.study.xmlhttphrequest.vo.PostVO;

/**
 * 示例 controller
 */
@RestController
@RequestMapping("/xmlhttpRequest")
public class XmlHttpRequestController {


    /**
     * get请求示例
     * @return
     */
    @RequestMapping(value = "/get",method = RequestMethod.GET)
    public RestResult get(@RequestParam String id,@RequestParam String address){
        return RestResult.SUCCESS(id);
    }

    /**
     * post请求示例
     * @return
     */
    @RequestMapping(value = "/post",method = RequestMethod.POST)
    public RestResult post(@RequestBody PostVO postVO){
        return RestResult.SUCCESS(postVO);
    }
}
